<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@page import="henu.javaweb.util.WebDbPool"%>
<%@page import="java.sql.*"%>
<%@page import="henu.javaweb.bean.*" %>
<%@page import="henu.javaweb.dao.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>学生信息管理系统</title>
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/my.css">
<script type="text/javascript" src="../../js/Calendar3.js"></script>
<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script>
if(window.name != "bencalie"){
    location.reload();
    window.name = "bencalie";
}
else{
    window.name = "";
}
</script>
<script type="text/javascript">

function move(){
   var qu = $("#college").val();
	
   switch(qu){
     case "医学院":
   	 	 $("#major").removeAttr("disabled");
     	 $("#major").empty();
     	 $("<option value='临床医学'>临床医学</option><option value='精神卫生'>精神卫生</option><option value='基础医学'>基础医学</option>").appendTo("#major");
     	 break;
     case "计算机与信息工程学院":
    	$("#major").removeAttr("disabled");
      	$("#major").empty();
      	$("<option value='计算机科学与技术'>计算机科学与技术</option><option value='软件工程'>软件工程</option><option value='网络工程'>网络工程</option>").appendTo("#major");
      	break;
     case "物理与电子学院":
    	$("#major").removeAttr("disabled");
      	$("#major").empty();
      	$("<option value='通信工程'>通信工程</option><option value='电子信息科学与技术'>电子信息科学与技术</option><option value='测控技术与仪器'>测控技术与仪器</option>").appendTo("#major");
      	break;
     default:
    	 $("#major").attr("disabled","disabled");
     	$("#major").empty();
     	$("<option>--请选择--</option>").appendTo("#major");
   }
}
</script>
</head>
<body>
	<%@include file="header.jsp" %>
		<div class="container">
			<form action="../../AlterStudentServlet" method="post" role="form">
			<table class="table table-striped table-bordered">
			<%
			if(request.getParameter("id")!=null){
				String id=request.getParameter("id").toString();
				StudentDao sd=new StudentDao();
				Student s=new Student(); 
				s=sd.findBySno(id);		
			%>
			<tr>
				<td>学号</td>
				<td><input type="text" name="sno" value="<%=s.getS_no() %>"  class="form-control"></td>
				<td>姓名</td>
				<td><input type="text" name="sname" value="<%=s.getS_name() %>" placeholder="请输入姓名 " class="form-control"></td>
				<td rowspan="3">照片</td>
			</tr>
			<tr>
				<td>曾用名</td>
				<td><input type="text" name="sbefore_name" value="<%=s.getS_nameUsed() %>" placeholder="若没有则不填" class="form-control"></td>
				<td>姓名拼音</td>
				<td><input type="text" name="pinyin" value="<%=s.getS_spellname() %>" placeholder="请输入姓名拼音" class="form-control"></td>
			</tr>
			<tr>
				<td>性别</td>
				<td>	
					<label class="radio-inline "><input type="radio" checked="checked"  name="sex" value="男"/>男</label>
					<label class="radio-inline "><input type="radio"  name="sex" value="女"/>女</label>	
				</td>
				<td>身份证号</td>
				<td><input type="text" name="sidcard" value="<%=s.getS_IDCard() %>" placeholder="请输入身份证号码" class="form-control"></td>
			</tr>
			<tr>
				<td>出生日期</td>
				<td><input class="form-control" name="birthday" type="text" id="control_date" size="10"
                      maxlength="10" onclick="new Calendar().show(this);" readonly="readonly" /></td>
				<td>民族</td>
				<td colspan="2"><input type="text" name="snation" value="<%=s.getS_nation() %>" placeholder="请输入民族"  class="form-control"></td>
			</tr>	
	
			<tr>
				<td>籍贯</td>
				<td><input type="text" name="snativePlace" value="<%=s.getS_nativePlace() %>"  class="form-control"></td>
				<td>政治面貌</td>
				<td colspan="2">
					<select class="form-control" name="status" >
						<option  value="共青团员">团员</option>
						<option  value="党员">党员</option>
						<option  value="群众">群众</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>联系电话</td>
				<td>
					<input type="text" class="form-control" name="phone" placeholder="请输入电话号码" value="<%=s.getS_phone() %>"/>
				</td>
				<td>电子邮箱</td>
				<td colspan="2">
					<input  type="text" class="form-control " name="email" placeholder="请输入电子邮件" value="<%=s.getS_email() %>"/>
				</td>
			</tr>
			<tr>
				<td>院系</td>
				<td>
					<select id="college" name="college" class="form-control" onchange="move()">
						<option>--请选择--</option>
						<option value="医学院">医学院</option>
						<option value="计算机与信息工程学院">计算机与信息工程学院</option>
						<option value="物理与电子学院">物理与电子学院</option>
					</select>
				</td>
				<td>专业</td>
				<td colspan="2">
					<select id="major" name="major" class="form-control" disabled="disabled">
						<option>--请选择--</option>			
					</select>
				</td>
			</tr>
			<tr>
				<td>备注</td>
				<td colspan="4">
					<input  type="text" class="form-control " name="remark" placeholder="备注" value="<%=s.getS_remarks() %>"/>
				</td>
			</tr>
			<tr>
				<td colspan="5">
				    <div class="col-xs-offset-5 col-xs-1">
      					<input type="submit" class="btn btn-primary" value="保存"></input>
   		 			</div>
   					<div >
      					<input type="reset" class="btn btn-warning" value="重置"></input>
   		 			</div>
				</td>
			</tr><%} %>
		</table>
		</form>
	</div>
</body>
</html>